@extends('admin.common.base-master')

@section('html-head')
    <link href="{{url('css/admin/pagenum.css')}}" rel="stylesheet" />

    <link rel="stylesheet" href="{{url("css/autocomplete.css")}}">
    <script src="{{url('js/autocomplete.js')}}"></script>
    <style>
        .sx{padding: 10px}
        .sx-btn{width: 64px;height: 30px;background-color: #4dbcd3;color: #fff;border: #4dbcd3;border-radius: 7%;}
        .autocomplete-button{
            display: none;
        }
        .proposal-list li{
            background-color: white !important;
        }
        li.proposal.selected{
            background-color: rgb(175, 42, 0) !important;
        }
    </style>
@endsection

@section('html-body')
    <!-- content start -->
    <div id="content">
        <!-- cur-position start -->
        <div id="cur-position">
            <span class="tit">当前位置：</span>
            <a href="#">财务管理</a>
        </div>
        <!-- cur-position end -->

        @include('admin.common.finance-header')

        <div class="filter-box clearfix">
            <div class="fl" style="display: inline-flex">
                <div class="sx">
                    <input class="gg-ipt" style="width: 180px;height: 26px" type="text" placeholder="输入昵称" name="nickname" id="nickname" value="{{$nickname}}" />
                </div>
                <div class="sx">
                    <button class="sx-btn" id="sou_btn">搜索</button>
                </div>
            </div>
        </div>

        <div class="table-box">
            <table class="table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户昵称</th>
                    <th>用户头像</th>
                    <th>购币数量</th>
                    <th>充值金额</th>
                    <th>支付方式</th>
                    <th>充值时间</th>
                    {{--<th>操作</th>--}}
                </tr>
                </thead>
                <tbody>
                @if(count($userSpendRecords) > 0)
                    @foreach($userSpendRecords as $a)
                        <tr id="recharge_{{$a->id}}">
                            <td>{{$a->id}}</td>
                            <td>{{$a->nickname}}</td>
                            <td><img src="{{$a->photo_url}}" alt="" width="40"></td>
                            <td>{{$a->books_coin_num}}</td>
                            <td>{{$a->amount_money}}</td>
                            <td>{{$a->pay_type}}</td>
                            <td>{{$a->created_at}}</td>
                            {{--<td><a href="javascript:void(0);" class="del" data-id="{{$a->id}}">删除</a></td>--}}
                        </tr>
                    @endforeach
                @endif
                </tbody>
            </table>
            <?php echo $userSpendRecords->appends(['nickname' => $nickname])->render(); ?>
        </div>
    </div>
    <script>
        $(function(){
            $('#sou_btn').click(function () {
                var nickname  = $("#nickname").val();

                window.location.href = "{{route('Admin.Home.rechargeList')}}?nickname="+nickname;
            });
        });
    </script>
    <!-- content end -->

@endsection